class PowerTabInputStream

  # Attributes
  attr_reader :stream

  # Constructor
  def initialize (file_name = nil)
    @class_count = 0
    @object_id = [ ]
    @stream = nil

    return false unless file_name
    @stream = File.open(file_name) # read/binary
    return false unless @stream
  end

  # Methods
  def map_object(mfc_name)
    @class_count++
    @object_id[mfc_name] = (0x8000 | @class_count) unless @object_id[mfc_name]
  end

  def object_id(mfc_name)
    return @object_id[mfc_name]
  end

  def class_id(header)
    ob_tag = ((header & 0x8000) << 16) | (header & ~0x8000)
    class_index = (ob_tag & ~0x80000000)  
  end

end
